﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Moned;

namespace Supermarket_management_system
{
    public partial class goodtable : Form
    {
        public goodtable()
        {
            InitializeComponent();
        }
        public List<Foodsinfo> zailist { get; set; }

        public void TKDZ(List<Foodsinfo> list)
        {
            this.zailist = list;
 
        }
        public Foodsinfo MyProperty { get; set; }

        private void goodtable_KeyUp(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                dataGridView1.AutoGenerateColumns = false;
                dataGridView1.DataSource = zailist;
            }
        }

        private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dataGridView1.SelectedRows.Count == 1)
            {
                int s = dataGridView1.SelectedRows[0].Index;
                MyProperty  = zailist[s - 1];
                this.Close();
 
            }
        }
    }
}
